import pymysql
conn = pymysql.connect(host='localhost',)
cursor = conn.cursor()
cursor.execute("select * from book_info")
for row in cursor:
    print(row)